import bot from "./model/bot/amesu";
import { fontMap } from "./model/gm/Lable";
// import Node from "./model/gm/Node";
import { BOT_MSG_AT } from "./model/bot/botType";
import server from "./model/client/server";
import { loadModules } from "./model/msgHandle/packge_tool";
import { join } from "path";
import browser from "./model/browser/browser";
import func from "./model/func";
/**
 * 线上测试
 * @param this 
 */
async function main(this: any) {
    func.server = '43.136.14.72'
    func.pngDir = 'bot.nfiii.cn'
    browser._init()
    bot.setBotConfig({
        appid: '101983837',
        token: 'KRT0MyhsrJ4YGQXSyzAJiOJti58K982N',
        events: [
            'PUBLIC_GUILD_MESSAGES',
            // 'GUILD_MESSAGE_REACTIONS'
        ],
        secret: 'IUgt6JWjw9Nbp3HVjyDShwBQfvBRhxDT',
        sandbox: false,
        log_level: 'INFO',
    })

    // 连接服务器
    await server.setWsUrl(`ws://${func.server}:8848`);

    // 初始化游戏
    const loadDir = join(__dirname, "packge");
    loadModules(loadDir);
}

main();